function demo(Nv,precision)

	if nargin<1
		Nv=64;
		fprintf('Using default Nv=%d\n',Nv);
	end
	
	if nargin<2
		precision='single';
		fprintf('Using default precision=%s\n',precision);
	end
	
	rng('default');
	K=500;

	% Generate random projections - clean, no shifts
	SNR=1;          % Not relevant
	max_shift=0;    % Not relevant
	step_size=1;    % Not relevant
	noise_type='Gaussian'; % Not relevant
	silent=0;
	fprecomp=['data' filesep precision '_riboprecomp.mat'];
	if ~ exist(fprecomp,'file')
		[projections, ~, ~, q] = generateProjections(K,SNR,max_shift,step_size,noise_type,silent,fprecomp);
	else
		fprintf('loading projections... ');
		load(fprecomp);
		fprintf('done!\n');
	end

	% The variable q contains the quternions that correspond to the
	% orientations of the simulated projections.
	% Now reconstruct the molecule back.

	n_r=ceil(size(projections,1)/2);
	n_theta=360;
	fcryoprecomp=['data' filesep precision '_cryoprecomp.mat'];
	if ~ exist(fcryoprecomp,'file')
		[pf,~]=cryoPolartFT(projections,n_r,n_theta,precision);  % take Fourier transform of projections
		X=cryoVolume2Rays(pf);
		save(fcryoprecomp,'X');
	else
		fprintf('loading Fourier transform of projections... ');
		load(fcryoprecomp);
		fprintf('done!\n');
	end

	nr=size(X,2);
	%T1p=Nv/(nr*(Nv+1));
	dir=Q2S2(q,n_theta);
	dir=cast(dir,precision);
	vol=fastReconstruct3D(X,dir,Nv/(nr*(Nv+1)),2,Nv,precision);
	ii=norm(imag(vol(:)))/norm(vol(:));
	fprintf('Imaginary part = %E\n',ii);
	vol_reconstructed=real(vol);
	reconstruct_mrc=['data' filesep precision '_vol_reconstruct_' int2str(Nv) '.mrc'];
	writeMRC(vol_reconstructed,1,reconstruct_mrc);
	cleanribfile=['data' filesep 'cleanrib.mat'];
	load(cleanribfile); % This is the clean E. Coli Ribosome
	clean_mrc=['data' filesep 'vol_clean.mrc'];
	writeMRC(real(volref),1,clean_mrc);
    fs=FSCorr(volref,vol_reconstructed);
    plot(fs);
end